#pragma once
#include <vector>
#include "D:\C_learning\CPP\MyVector\MyVector.h"
#include "D:\C_learning\CPP\MyVector\MyIterator.h"

namespace my {
	template <class T>
	class stack {
	private:
		std::vector<T> _container;
	public:
		//constructor
		stack(const T& data = T()) 
			:_container(data)
		{ }

		bool empty() const {
			return _container.empty();
		}

		size_t size() const {
			return _container.size();
		}

		T& top() {
			return _container.back();
		}

		const T& top() const {
			return _container.back();
		}

		void push(const T& val) {
			_container.push_back(val);
		}

		void pop() {
			_container.pop_back();
		}

		void swap(stack& x) {
			_container.swap(x._container);
		}
	};
}